package com.example.administrator.managesystem.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.example.administrator.managesystem.R;
import com.example.administrator.managesystem.activity.firstpage.circle.interfaces.OnItemCollectClickListener;
import com.example.administrator.managesystem.activity.firstpage.circle.interfaces.OnItemPictureClickListener;
import com.example.administrator.managesystem.activity.firstpage.circle.interfaces.OnItemRepostClickListener;
import com.example.administrator.managesystem.adapter.holder.MyCollectCircleHolder;
import com.example.administrator.managesystem.adapter.holder.MyShareCircleHolder;
import com.example.administrator.managesystem.base.BaseAdapter;
import com.example.administrator.managesystem.base.BaseHolder;
import com.example.administrator.managesystem.bean.CollectCircleBean;
import com.example.administrator.managesystem.bean.ShareCircleBean;

import java.util.List;

public class MyCollectCircleAdapter extends BaseAdapter<CollectCircleBean.DataBean> {
    private List<CollectCircleBean.DataBean> list;
    private Context context;
    private final int ITEM_TEXT=0;
    private final int ITEM_EMPTY=1;
    private OnItemPictureClickListener pictureListener;
    private OnItemCollectClickListener collectListener;
    private OnItemRepostClickListener repostListener;

    public MyCollectCircleAdapter(Context context, List<CollectCircleBean.DataBean> list) {
        super(context, list);
        this.context = context;
        this.list=list;
    }

    public void addDatas(List<CollectCircleBean.DataBean> list){
        this.list=list;
        notifyDataSetChanged();
    }
    public void addPictureListener(OnItemPictureClickListener pictureListener){
        this.pictureListener=pictureListener;
    }
    public void addCollectListener(OnItemCollectClickListener collectListener){
        this.collectListener=collectListener;
    }
    public void addRepostListener(OnItemRepostClickListener repostListener){
        this.repostListener=repostListener;
    }
    @Override
    public int getHolderType(int position) {
        return ITEM_TEXT;
    }



    @Override
    public BaseHolder createBaseHolder(ViewGroup parent, int viewType) {
       MyCollectCircleHolder holder = null;
        switch (viewType){
            case ITEM_TEXT:
                holder = new MyCollectCircleHolder(LayoutInflater.from(context).inflate(R.layout.item_circle,parent,false),pictureListener,collectListener,repostListener);
                break;
        }
        return holder;
    }



}